Chris Pollett > Old Classses >
CS174

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Description]
  [Course Outcomes]
  [Outcomes Matrix]
  [Course Schedule]
  [Grading]
  [Requirements/HW/Quizzes]
  [Class Protocols]
  [Exam Info]
  [Regrades]
  [University Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Midterm]  [Final]

                           












CS174 Spring 2016Practice Midterm

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test.

  1. Give an example HTTP 1.1 request to get a page cool_stuff.html in the document root folder on the web site http://stuff_you_want.com/ that would be sent by the IMAGreatBrowser user-agent. Give an example of a successful response message that the web server might return.
  2. Give the XHTML 5 code for a validating web page with title Form Data Poster and with a single form on it that has a text field with label Enter Some Text and a submit button.
  3. Explain and give an example of the following CSS concepts: (a) class selector, (b) pseudo selector, (c) relative positioning, (d) external stylesheet.
  4. What is the box model? Diagram and explain each of its components.
  5. Explain the Model View Adapter pattern.
  6. Give the PHP needed to connect to a MySQL database named MyDatabase on localhost using the default port, username, and password using the mysqli interface. Your script should after connecting, create a table MY_TABLE with a single integer column NUM_SO_FAR. It should insert one row with value 0 then it should update this row to set the value to 5. Finally, your script should query this table to get all the rows (just 1) back.
  7. Explain the HTTP needed for a cookie to be set of by a server, explain the HTTP by which a client can return a cookie, finally, explain what sessions are and how they are implemented using cookies.
  8. Write PHP code to define an abstract class Foo with one public abstract method getFoo() in the namespace practice_makes_perfect_company\midterm. Write code to subclass this class with a class ConcreteFoo which implements this method with a function that returns the string "foo".
  9. Give the git commands to create a patch and give an example of doing this. Give the git commands to apply a patch and give an example of doing this.
  10. Briefly describe the POST-REDIRECT-GET design pattern.